#!/usr/bin/python

# This is problem2

def fib(n):
	a, b = 0,1
	for i in range(n):
		a, b = b, a+b
	return b

number = 0 
even_sum = 0
while True:
	number += 1
	fibbs = fib(number)
	if fibbs >= 4000000:
		break
	if fibbs % 2 == 0:
		even_sum += fibbs
print even_sum
